import { get, getObj } from '@/api/system/dictDetail'

export default {
  data() {
    return {
      dicts: [],
      dictobj: {}
    }
  },
  methods: {
    async getDict(name) {
      return new Promise((resolve, reject) => {
        get(name).then(res => {
          this.dicts = res.data.page.data
          resolve(res)
        }).catch(err => {
          reject(err)
        })
      })
    },
    async getDictObj(names) {
      return new Promise((resolve, reject) => {
        getObj(names).then(res => {
          this.dictobj = res.data
          resolve(res)
        }).catch(err => {
          reject(err)
        })
      })
    }
  }
}
